'''
获取页面上相同class的标签内容
'''
from urllib.request import urlopen
from bs4 import BeautifulSoup

html = urlopen("https://www.douban.com/gallery/")
bsObj = BeautifulSoup(html, 'html.parser')

nameList = bsObj.findAll('span', {'class': 'topic_name'})
for x in nameList:
    print(x.get_text())
